/* This file is part of the Crimsoon project
  * Copyright (C) 2009 Eduardo Henrique <eduardohleite@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public License
  * along with this library; see the file COPYING.LIB.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
*/

#ifndef GALLERY_H
#define GALLERY_H

#include <QObject>
#include <QList>

#include "musicfile.h"
#include "album.h"

class QSqlQuery;
class QStringList;

enum AlbumStatus
{
    AlbumNotExists,
    AlbumNoPicture,
    AlbumHasPicture
};

class Gallery : public QObject
{
private:
    bool connect();
    void disconnect();

public:
    Gallery();
    ~Gallery();

    qint32 getTotalFiles();
    bool addAudioFile(MusicFile fileInfo, qint32 dirCode);
    bool removeAudioFile(QString path);
    void beginBulk();
    void endBulk();
    QStringList getAllArtistNames();
    QStringList getAllAlbunsByArtist(QString artist);
    qint32 addScanDir(QString path);
    bool hasPath(QString path);
    AlbumStatus hasAlbum(Album album);
    bool addAlbum(Album album);
    bool removeFilesFromDir(QString path);
    Album getAlbum(QString artist, QString title);
    QSqlQuery getQueryAllFiles();
    QSqlQuery getQueryArtistFiles(QString artist);
    QSqlQuery getQueryAlbumFiles(QString artist, QString album);

    MusicFile getMusicFileInfo(QString path);
};

#endif // GALLERY_H
